Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Borrow and stake support pcape #413

Merged
merged 8 commits into from
Sep 5, 2023
Merged

Conversation

zhoujia6139
Copy link
Contributor

Security Checklist

  • 1. Re-Entrancy
  • 2. Arithmetic Over/Under Flows
  • 3. Unexpected Ether
  • 4. Delegatecall
  • 5. Default Visibilities
  • 6. Entropy Illusion
  • 7. External Contract Referencing
  • 8. Short Address/Parameter Attack (off chain)
  • 9. Unchecked CALL Return Values
  • 10. Race Conditions / Front Running
  • 11. Denial Of Service (DOS)
  • 12. Block Timestamp Manipulation
  • 13. Constructors with Care
  • 14. Uninitialized Storage Pointers
  • 15. Floating Points and Precision
  • 16. Tx.Origin Authentication
  • 17. Address.isContract Re-Entrancy via Constructor

⚠️ NOTES ⚠️

Make sure to think about each of these exploits in this PR.

@zhoujia6139 zhoujia6139 requested a review from a team as a code owner September 3, 2023 07:14
0,
stakingInfo.cashAmount
);
IPToken(PCAPE).burn(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we check if we need to turn off collateral?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah. We should.

0,
stakingInfo.cashAmount
);
IPToken(PCAPE).burn(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we already read cApeReserveCache, why not we just use xTokenAddress from that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes,we can.

@@ -553,12 +553,21 @@ export const deployPoolApeStaking = async (

const config = getParaSpaceConfig();
const treasuryAddress = config.Treasury;

const cApe = await getAutoCompoundApe();
let pcApeAddress = "0x5F56386F21766237707a447FB37C717dC221bb13"; //for test env
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this breaks other deployment

DataTypes.ReserveCache memory cApeReserveCache = cApeReserve
.cache();
address PCAPE = cApeReserveCache.xTokenAddress;
require(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest require user's pcApe balance >= cashAmount

stakingInfo.cashAsset == PCAPE,
Errors.INVALID_ASSET_TYPE
);
cApeReserve.updateState(cApeReserveCache);
Copy link

@billyz9611 billyz9611 Sep 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest check cAPE status is not Paused and is Active

@GopherJ GopherJ self-requested a review September 5, 2023 07:13
@GopherJ GopherJ merged commit ce0e0f2 into main Sep 5, 2023
@GopherJ GopherJ deleted the borrow_and_stake_support_pcape branch September 5, 2023 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants